package com.qs.education.controllers;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationSubjectBean;
import com.qs.education.bean.enums.ResponseStatus;
import com.qs.education.service.ISubjectAPIService;

/**
 * 
 * @class SubjectController
 * @author Jason
 * @description
 * @date Nov 8, 2018 10:38:34 AM
 */
@RestController
public class SubjectController {
	
	@Autowired
	private ISubjectAPIService subjectAPIServiceImpl;

	private final Logger log = Logger.getLogger(this.getClass());
	
	/**
	 * @Description 查询所有学科
	 * @author Jason
	 * @date Nov 8, 2018
	 * @param request
	 * @return
	 */
	@RequestMapping("/getSubjectListAPI")
	public ResponseListBean<EducationSubjectBean> getSubjectList(HttpServletRequest request) {

		log.info("api Subject 端 Controller  getSubjectList");
		ResponseListBean<EducationSubjectBean> response = new ResponseListBean<EducationSubjectBean>();
		response.setToken(response.getToken(request));
		response = subjectAPIServiceImpl.getEducationSubjectList();
		response.setStatus(ResponseStatus.SUCCESS.toString());

		return response;
	}
}
